home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 December / MACPOWER-1997-12.ISO.7z / MACPOWER-1997-12.ISO / AMUG / PROGRAMMING / Raven 1.2 Examples.sit / Raven 1.2 Examples / BoxPaint / Source / Pencil.h < prev    next >
Text File  |  1997-03-09  |  2KB  |  89 lines

  1. /*
  2.  *  File:       Pencil.h
  3.  *  Summary:    A 3D mouse cursor in the shape of a pencil.
  4.  *  Written by: Jesse Jones
  5.  *
  6.  *  Copyright ゥ 1997 Jesse Jones. 
  7.  *    For conditions of distribution and use, see copyright notice in ZTypes.h  
  8.  *
  9.  *  Change History (most recent first):
  10.  *
  11.  *         <->      3/09/97    JDJ        Created.
  12.  */
  13.  
  14. #pragma once
  15.  
  16. #include <Z3DAttributeSet.h>
  17. #include <Z3DGroups.h>
  18. #include <Z3DMatrix.h>
  19. #include <Z3DPrimitives.h>
  20.  
  21.  
  22. //-----------------------------------
  23. //    Forward References
  24. //
  25. class T3DView;
  26.  
  27.  
  28. // ===================================================================================
  29. //    struct S3DCursorLocation
  30. // ===================================================================================
  31. struct S3DCursorLocation {
  32.     T3DPoint    location;
  33.     T3DVector    toward;
  34.     T3DVector    up;
  35. };
  36.  
  37.  
  38. // ===================================================================================
  39. //    class CPencil
  40. // ===================================================================================
  41. class CPencil {
  42.  
  43. //-----------------------------------
  44. //    Initialization/Destruction
  45. //
  46. public:
  47.     virtual                ~CPencil();
  48.                         
  49.                         CPencil();
  50.                         // Starts out hidden.
  51.                         
  52. //-----------------------------------
  53. //    API
  54. //
  55. public:
  56.             void         Show();
  57.             
  58.             void         Hide();
  59.             
  60.             void         MoveTo(const S3DCursorLocation& loc);
  61.             
  62.             void         Submit(const T3DView& view);
  63.             
  64.             void         Scale(const T3DDisplayGroup& model, const T3DView& view, float scale);
  65.                         // Make the pencil's size scale times the model size.
  66.             
  67. //-----------------------------------
  68. //    Internal API
  69. //
  70. public:                        
  71.             void         CreatePencil();
  72.             
  73.             void         CreateOrientationModel();
  74.             
  75. //-----------------------------------
  76. //    Member Data
  77. //
  78. protected:
  79.     bool                mShowOrientation;        //    to show the direction the cursor is pointing    
  80.     T3DDisplayGroup        mPencilModel;            //    the Cursor Shape    
  81.     T3DDisplayGroup        mOrientationModel;        //    the orientation indicator    
  82.     S3DCursorLocation    mCursorPlacement;        //    Where is the cursor?    
  83.     T3DMatrix            mTransform;                //    Local to World space    
  84.     T3DVector            mScale;                    //    the relative size    
  85.     T3DAttributeSet        mCursorAttributeSet;    //    Attributes for the whole cursor    
  86. };
  87.  
  88.  
  89.